<?php

namespace app\admin\service;

use app\admin\model\PoliteComprehensive;

class ComprehensiveService
{
    public static function getFoodMerchants(): array
    {
        $model=new PoliteComprehensive();
        $list=$model->where(['category'=>1])->order('order asc')->field('id,name')->select();
        return $list->isEmpty()?[]:$list->toArray();
    }
    public static function getNameById($id){
        $model=new PoliteComprehensive();
        $row=$model->where(['id'=>$id])->field('name')->find();
        if(!$row){
            return false;
        }
        return $row['name'];
    }
}